package org.cytoscape.myapp.cytoscape_app_v1.internal.visual;

import java.util.HashMap;

import org.cytoscape.myapp.cytoscape_app_v1.internal.helpers.ModelUtils;
import org.cytoscape.view.model.VisualProperty;
import org.cytoscape.view.presentation.property.BasicVisualLexicon;
import org.cytoscape.view.vizmap.VisualMappingFunction;
import org.cytoscape.view.vizmap.mappings.DiscreteMapping;

public class MappingFunctionConcreteDiscreteSimple implements MappingFunctionFactory{

	@Override
	public <T> VisualMappingFunction createVisualMappingFunction(
			String attribute, Class<? extends T> type,
			VisualProperty<T> property,
			HashMap<String, Object> propertyAttributes,
			VisualInstanceDependecies dependecies) {
		
		DiscreteMapping<Double, Double> mapping = (DiscreteMapping<Double, Double>)
				dependecies.getVmfFactoryD().createVisualMappingFunction("Social Centrality", Double.class, BasicVisualLexicon.NODE_SIZE);
		
		mapping.putAll(ModelUtils.getDiscreteMapping(dependecies.getApplicationManager().getCurrentNetwork(),"Social Centrality" ));
		
		return mapping;
	}

}
